package com.iawg.attrition.engine.renderer;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

public class NetworkRenderer extends Renderer<NetworkElement> {

	Socket target;
	
	public NetworkRenderer(Socket target) {
		this.target = target;
	}
	
	@Override
	public void print(String message) {
		//do nothing for now
	}

	@Override
	public void render(NetworkElement element) {
		try {
			ObjectOutputStream oos = new ObjectOutputStream(target.getOutputStream());
			oos.writeObject(element);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
